package com.msmall.community.wiki.service;

import com.msmall.base.pager.PaginationSupport;
import com.msmall.base.service.BaseManager;
import com.msmall.community.klg.model.Article;
import com.msmall.community.wiki.model.WikiSegmentArticle;

public interface WikiManager extends BaseManager{

	/**
	 * 通过字典/百科所属于的分类找出对应的文章
	 */
	public Article getBySegmentid(Long segid) throws Exception;
	
	public WikiSegmentArticle getByArticleid(Long articleid) throws Exception;
	
	/**
	 * 用户是否被授权推荐问答
	 */
	public boolean isAuthorizedCommend(Long userid);
	/**
	 * 用户是否被授权删除问答/回复
	 */
	public boolean isAuthorizedRemove(Long userid);
	
	/**
	 * 用户是否被授权创建问答/回复
	 */
	public boolean isAuthorizedCreate(Long userid);
	
	/**
	 * 用户是否被授权更新问答/回复
	 */
	public boolean isAuthorizedUpdate(Long userid);
	/**
	 * 创建新的WIKI文章
	 * @param article
	 * @param segid 文章分类ID
	 * @param userid creator
	 * @param userAgentType
	 * @return
	 */
	public Article saveWiki(Article article, Long segid, Long userid, String userAgentType) throws Exception;
	
	/**
	 * 获得某文章的分类.enabed or not都选出
	 * @param page
	 * @param userid 当前登录系统的用户，用于分页的PAGESIZE
	 * @param articleid 文章ID
	 */
	public void getPaginationByArticle(PaginationSupport page, Long userid, Long articleid) throws Exception;
}
